@echo off
chcp 65001 >nul

echo =========================================
echo XPath Locator Tool - Quick Start
echo =========================================

REM Start backend
echo Starting backend service...
start "Backend" cmd /k "cd /d %~dp0backend && conda activate fetch && python -m uvicorn app.main:app --host 127.0.0.1 --port 8000"

REM Wait for backend
echo Waiting for backend to initialize...
timeout /t 3 /nobreak >nul

REM Start frontend
echo Starting frontend service...
start "Frontend" cmd /k "cd /d %~dp0frontend && npm run dev"

echo.
echo =========================================
echo Services are starting in separate windows
echo Backend: http://127.0.0.1:8000
echo Frontend: http://localhost:5173
echo API Docs: http://127.0.0.1:8000/docs
echo =========================================

pause